import Vue from 'vue'
// import axios from 'axios'
// import VueAxios from 'vue-axios'
import axios from './http'

import Antd, {Modal, notification} from 'ant-design-vue'
import 'ant-design-vue/dist/antd.css'

import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import { Loading } from 'element-ui';

import qs from 'qs'
import router from './router'
import store from './store'

import App from './App.vue'
import './theme/index.less'

import './utils/WindowUtils'

Vue.config.productionTip = false

// Vue.use(VueAxios, axios)
Vue.use(Antd)
// Vue.use(ElementUI);
Vue.use(Loading)

Vue.prototype.$alert = Modal
Vue.prototype.$qs = qs
Vue.prototype.$http = axios
if (sessionStorage.getItem('LOGIN_INFO')) {
  // Vue.prototype.$tenantInfo = JSON.parse(sessionStorage.getItem('TENANT_INFO'))
  Vue.prototype.$loginInfo = JSON.parse(sessionStorage.getItem('LOGIN_INFO'))
} else {
  Vue.prototype.$loginInfo = {}
}
notification.config({
  placement: 'bottomRight',
  duration: 3,
});

Vue.directive('focus', {
  inserted: (el) => {
    if (el.tagName === 'INPUT') {
      el.focus()
    } else {
      el.querySelector('INPUT').focus()
    }
  },
})

import './components/index.js'

new Vue({
  render: (h) => h(App),
  store,
  router,
}).$mount('#app')
